From 9ed24df7b1e951129e4c992d0a528c966b6ecf0c Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Thu, 5 Oct 2006 15:48:26 -0500 Subject: [PATCH] [POWERPC][XEN] Builtin cmdline dependency rule Rebuild cmdline.o when the user changes the CMDLINE=X argument passed to the make invocation. I couldn't find an example of another project that handles this case properly, so I came up with this. Signed-off-by: Amos Waterland Signed-off-by: Hollis Blanchard --HG-- extra : transplant_source : %1D0%5E%9CslQ%E7E%CC%8FS%B8%E1%E5%C5i%ED%F1%BE --- .hgignore | 1 + xen/arch/powerpc/Makefile | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.hgignore b/.hgignore index 8e06df448d..da7b38f898 100644 --- a/.hgignore +++ b/.hgignore @@ -222,6 +222,7 @@ ^xen/arch/powerpc/xen\.lds$ ^xen/arch/powerpc/.xen-syms$ ^xen/arch/powerpc/xen-syms.S$ +^xen/arch/powerpc/cmdline.dep$ ^unmodified_drivers/linux-2.6/\.tmp_versions ^unmodified_drivers/linux-2.6/.*\.cmd$ ^unmodified_drivers/linux-2.6/.*\.ko$ diff --git a/xen/arch/powerpc/Makefile b/xen/arch/powerpc/Makefile index 32a049c001..4657c9bedf 100644 --- a/xen/arch/powerpc/Makefile +++ b/xen/arch/powerpc/Makefile @@ -80,6 +80,20 @@ ifneq ($(CMDLINE),) # The first token in the arguments will be silently dropped. FULL_CMDLINE := xen $(CMDLINE) endif + +ifeq ($(wildcard cmdline.dep),) +cmdline.dep: + echo $(FULL_CMDLINE) > cmdline.dep +else +ifneq ($(FULL_CMDLINE),$(shell cat cmdline.dep)) +cmdline.dep:: + echo $(FULL_CMDLINE) > cmdline.dep +else +cmdline.dep: +endif +endif + +cmdline.o: cmdline.dep cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\"" TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds @@ -123,4 +137,4 @@ dom0.bin: $(DOM0_IMAGE) clean:: $(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean - rm -f firmware firmware_image.bin dom0.bin .xen-syms + rm -f firmware firmware_image.bin dom0.bin .xen-syms cmdline.dep -- 2.30.2